package com.jiangnan.api.service

import com.jiangnan.entity.CreditLog
import com.jiangnan.entity.Res
import retrofit2.http.*

interface CreditApiService {
  @GET("credit/return")
  suspend fun returnBook(
    @Query("userId") userId: Long,
    @Query("borrowId") borrowId: Long,
    @Query("borrowDate") borrowDate: String,   // ISO 格式，如 "2025-04-20T10:00:00"
    @Query("returnDate") returnDate: String
  ): Res<Unit>

  @GET("credit/{userId}")
  suspend fun getCredit(@Path("userId") userId: Long): Res<Int>

  @GET("credit/logs/{userId}")
  suspend fun getLogs(@Path("userId") userId: Long): Res<List<CreditLog>>
}